
const mysql = require("mysql2");
const pool = mysql.createPool({
    host: process.env.MYSQL_HOST,
    user: process.env.MYSQL_USER,
    database: process.env.MYSQL_DATABASE,
    waitForConnections: true,
    connectionLimit: 10,
    port: 3306,
    password: process.env.MYSQL_PASSWORD,
    maxIdle: 10, // max idle connections, the default value is the same as `connectionLimit`
    idleTimeout: 600000, // idle connections timeout, in milliseconds, the default value 60000
    queueLimit: 10,
    enableKeepAlive: true,

    keepAliveInitialDelay: 0,
});
module.exports = {
    promisePool: pool.promise()
}